﻿@namespace CodeManDesktopBlazor.BlazorComponents.Pages.codeTemple
@typeparam K
@typeparam T
@{
    int count = 1;
    string desc = "";
    string descEnd = "";
    string tnamespace = Model.classGenDTO.Namespace.IsNullOrWhiteSpace() ? "" : $"{Model.classGenDTO.Namespace}.";
}

<div class="div-code">
@("{\n")
    <p class="p-c">"@(tnamespace+Model.classGenDTO.Name.ToTitleCase())":{@("\n")</p> 
    @foreach (var item in Model.classAttributeDTOLst)
    {
        desc = item.ADesc.IsNullOrWhiteSpace() ? item.AName.ToTitleCase() : item.ADesc.ToTitleCase();
        descEnd = count == Model.classAttributeDTOLst.Count ? "\n" : $",\n";
        <p class="p-a">"@AttrTemplate(item)": "@desc"@descEnd</p>
        count++;
    } 
    <p class="p-c">}</p>
@("\n}") 
</div>

